<?php
/**
 * WebLog class
 *
 */
class WebLog extends Zend_Log
{
	const ONEPAY_LOG = 'PAYPAL_LOG';
	const EMAIL_LOG = 'EMAIL_LOG';
	
	/**
	 * Constructor of weblog
	 */
	public function __construct($logType = null)
	{
	}

	/**
	 * Write log
	 * @param string $data
	 * @param string $logType
	 */
	public function writeLog($data, $logType = null)
	{
		if(is_null($data)){
			return null;
		}
		
		switch ($logType){
			case self::ONEPAY_LOG:
				file_put_contents(LOGGING_PATH . '/PaypalLog/paypal_' . date("Y-m-d") . '.txt', $data, FILE_APPEND | LOCK_EX);
				break;
			case self::EMAIL_LOG:
				file_put_contents(LOGGING_PATH . '/EmailLog/email_' . date("Y-m-d") . '.txt', $data, FILE_APPEND | LOCK_EX);
				break;
			default:
				break;
		}
	}
}